﻿using System;
using System.Collections.Generic;
using System.Xml.Serialization;

namespace LdtJudge.DataEngine.Model.Dudection
{

    /// <summary>
    /// 推导服务结果集合
    /// </summary>
    public class DeduceResultList
    {
        /// <summary>
        /// 推导服务结果集合
        /// </summary>
        public List<DeduceResultModel> DeduceOutResult { get; set; }
    }

    /// <summary>
    /// 对接推导服务返回的类结构
    /// </summary>
    public class DeduceResultModel
    {
        /// <summary>
        /// 规则编号，这个编号对应着一个业务推导配置文件
        /// </summary>
        public string RuleCode { get; set; }

        public string RuleToAnalysisCode { get; set; }
        /// <summary>
        /// 编号
        /// </summary>
        public string Code { get; set; }

        /// <summary>
        /// 删除Xpath
        /// </summary>
        public string DeleteData { get; set; }
        /// <summary>
        /// 推导结果集，程序主要获取的就是这类的内容
        /// =================================操作方式==============================
        /// 1.从Result集合里面获取Name为ID、路径、操作类型三个的OperateResult的值；
        /// 2.根据路径与ID确定在xml中的节点
        /// 3.依据操作类型（增、改）对查找到的节点的Result集合中其他项(属性)做对应的操作
        /// </summary>
        public List<ElementOutVo> Result { get; set; }
        /// <summary>
        /// 关联结果
        /// </summary>
        public List<RelationResultOutvo> RelationResult { get; set; }
    }

    /// <summary>
    /// 推导结果
    /// </summary>
    public class ElementOutVo
    {
        /// <summary>
        /// 输出结果的编号
        /// </summary>
        public string Code {get;set;} 
        /// <summary>
        /// 输出结果的名称
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 路径
        /// </summary>
        public string Path { get; set; }
        /// <summary>
        /// 解析类型
        /// </summary>
        public string ParseType { get; set; }
        /// <summary>
        /// 数据源
        /// </summary>
        public string Source { get; set; }
        /// <summary>
        /// 操作结果
        /// </summary>
        public string OperateResult { get; set; }

        /// <summary>
        /// 是否需要校验 1.需要0.为不需要
        /// </summary>
        public string checkCode { get; set; }
    }

    /// <summary>
    /// 关系结果
    /// </summary>
    public class RelationResultOutvo
    {
        /// <summary>
        /// 条件
        /// </summary>
        public string Condition { get; set; }
        /// <summary>
        /// 结果集
        /// </summary>
        public List<ResultOutvo> ResultList { get; set; }
    }

    /// <summary>
    /// 结果集
    /// </summary>
    public class ResultOutvo
    {
        /// <summary>
        /// 类型
        /// </summary>
        public string Type { get; set; }
        /// <summary>
        /// 结果值
        /// </summary>
        public string Value { get; set; }
    }
}
